import BaseApi from '../BaseApi';

const controller = "/charge";
const adminOrderController = "/adminOrder";

export default {
    //删除订单
    deleteOrder(condition) {
        return this.requestPost(adminOrderController, "/deleteOrder", condition);
    },
    //修改订单
    updateOrder(condition) {
        return this.requestPost(adminOrderController, "/updateOrder", condition);
    },
    //退款
    refund(condition) {
        return this.requestPost(adminOrderController, "/refund", condition);
    },
    // 渠道退款和余额退款
    channelRefund(condition) {
        return this.requestPost(adminOrderController, "/refundApplication", condition);
    },
    //退款记录列表
    refundRecordList(condition) {
        return this.requestPost(adminOrderController, "/refundRecordList", condition);
    },
    getChargeDatil(condition) {
        return this.requestPost(controller, "/chargeDetail", condition);
    },
    exportChargeExcel(condition) {
        return this.requestDownloadGet(controller, "/exportChargeExcel", condition);
    },
    //添加订单
    insertWalletRecord(condition) {
        return this.requestPost(controller, "/insertWalletRecord", condition);
    },

    /*请求封装*/
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);

    },

    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestDownloadGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestDownloadGet(newUrl, condition);
    }

}
